rem usage example: iphone_mkv.bat inputfile.mkv outputfile.mp4 eng jap
set input=%1
set output=%2
set slang=%3
set alang=%4
set temp=Temp\temp.mp4
set temp2=Temp\temp2.mp4
ECHO Stage: 1 of 3: Encoding
mencoder %input% -of lavf -lavfopts format=mp4 -vf-add scale=480:-10 -vf-add harddup -ofps 25 -af lavcresample=44100 -oac lavc -noskip -skiplimit 1 -mc 0 -ovc lavc -lavcopts aglobal=1:vglobal=1:acodec=libfaac:abitrate=128:vcodec=mpeg4:vbitrate=768:keyint=25 -aid %alang% -slang %slang% -subfont-text-scale 3 -o %temp%
ECHO Stage: 2 of 3: Preparing for iTunes 
nicmp4box -add %temp% %temp2%
ECHO stage: 3 of 3: Copying from Temp
move /Y %temp2% %output%
ECHO Cleaning Up
del %temp%
Echo Done.